{% for item in access_ports -%}

{% for access in item.ports %}
{% if "-" in access|string %}
interface range {{ access }}
{% else %}
interface {{ access }}
{% endif %}
  switchport mode access
  switchport access vlan {{ vlans[item.data].id }}
  {% if item.voice is defined -%}
  switchport voice vlan {{ vlans[item.voice].id }}
  {% endif -%}
  {% if item.group is defined -%}
  channel-group {{ item.group }} mode on
  {% endif -%}
  no shutdown
{% endfor %}

{% endfor %}
